const a = [];
const b = [
    {
        id: 1,
        name: 'a'
        age: 18
    },
    {
        id: 2,
        name: 'b'
        age: 20
    },
    {
        id: 3,
        name: 'c'
        age: 22
    }
]

a = b.map(item => {
     [...a, {
        id: item.id,
        name: item.name,
    }]
})

console.log(a)